//
//  main.cpp
//  CAP3 3.1
//
//  Created by 孙洋洋 on 2022/4/9.
//  Copyright © 2022 当狗的二象性. All rights reserved.
//
//向数组a中输入10个整数，求Max，min，average

#include <iostream>
using namespace std;
int main(int argc, const char * argv[])
{
    int a[10],as,sum;
    sum=0;
    cout<<"请输入10个数："<<endl;
    for (int i=0; i<10; i++)
    {
        cin>>a[i];//for循环输入a的元素
    }
    int max,min;
    max=min=a[0];
    for (int i=0; i<10; i++)//取max
    {
        if (a[i]>max)
        {
            max=a[i];
        }
    }
    for (int i=0; i<10; i++)//取min
    {
        if (a[i]<min)
        {
            max=a[i];
        }
    }
    for (int i=0; i<10; i++)//取average
    {
        
        sum=sum+a[i];
        
    }
   as=sum/10;
    cout<<"max="<<max<<endl;
    cout<<"min="<<min<<endl;
   cout<<"average="<<as<<endl;
}
